﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KylinORM.CQRS.Publisher
{
    /// <summary>
    /// 命令基类
    /// </summary>
    public abstract class MessageBase : IMessage
    {
        /// <summary>
        /// 创建一个命令
        /// </summary>
        public MessageBase()
        {
            this.GUID = Guid.NewGuid();
        }
        /// <summary>
        /// 创建指定名称的命令
        /// </summary>
        /// <param name="messageName"></param>
        public MessageBase(string messageName)
            : this()
        {
            this.MessageName = messageName;
        }

        #region IMessage 成员
        /// <summary>
        /// 命令的唯一标识符
        /// </summary>
        public Guid GUID
        {
            get;
            protected set;
        }
        /// <summary>
        /// 命令名称
        /// </summary>
        public string MessageName
        {
            get;
            protected set;
        }
        /// <summary>
        /// 命令类型
        /// </summary>
        public abstract EMessageType MessageType { get; }
        #endregion

    }
}
